const { upload} = require('./multer.js');
exports.create = (router)=>{
    router.post('/image/upload', upload.single('file'), (req, res, next) => {
        const file = req.file;
        console.log(file)
        if (!file) {
          const error = new Error('Please upload a file')
          error.httpStatusCode = 400
          return next(error)
        }
        res.send({
        massage: true,
        fileName:file.filename
        })
    })
}